package com.wxy.eneity;

import java.util.HashMap;

/**
 * @author 47868
 */
public class R extends HashMap<String,Object> {
    public R (){}
    public static R error(){
        return R.error(500,"服务端发生异常，请重试...");
    }
    public static R error(int code,String msg){
        R r = new R();
        r.put("code",code);
        r.put("msg",msg);
        return r;
    }
    public static R error(int code){
        return error(code,"服务端发生异常，请重试...");
    }
    public static R ok(String msg){
        R r = new R();
        r.put("msg",msg);
        return r;
    }
    public static R ok(String msg,Object data){
        R r = new R();
        r.put("msg",msg);
        r.put("data",data);
        return r;
    }
}
